package entry34.pre;

import static org.hamcrest.CoreMatchers.*;
import static org.junit.Assert.*;

import org.junit.Test;

public class Calculator {
	public int cal(int first, int last, String op) {
		return OperationHelper.op(op).apply(first, last);
	}
	
	@Test
	public void testCalcuator() {
		assertThat(cal(6, 3, "+"), is(9));
		assertThat(cal(6, 3, "-"), is(3));
		assertThat(cal(6, 3, "*"), is(18));
		assertThat(cal(6, 3, "/"), is(2));
		assertThat(cal(6, 3, "^"), is(216));
		assertThat(cal(6, 3, "%"), is(0));
	}
}
